import plotly.express as px
import pandas as pd
import random

# Simulate rolling three D6 dice.
results = []
for roll_num in range(1000):
    result = random.randint(1, 6) + random.randint(1, 6) + random.randint(1, 6)
    results.append(result)

# Analyze the results.
frequencies = pd.Series(results).value_counts().sort_index()

# Create a bar chart.
fig = px.bar(
    x=frequencies.index,
    y=frequencies.values,
    labels={'x':'Dice Sum', 'y':'Frequency'},
    title='Results of Rolling Three D6 1000 Times'
)

fig.show()
